<template>
  <Scene :event-list="eventList" />
  <Screen :data-info="dataInfo" :event-list="eventList" />
</template>

<script setup>
import Scene from '@/views/scene/index.vue'
import Screen from '@/views/screen/index.vue'

import { reactive, ref } from 'vue'

const dataInfo = reactive({})
const eventList = ref([])

changeInfo()

function changeInfo() {
  dataInfo.iot = {
    name: '接入IOT设备',
    number: 4205,
    unit: '台',
  }
  dataInfo.event = {
    name: '未处理治安事件',
    number: 8,
    unit: '起',
  }
  dataInfo.power = {
    name: '城市电力能耗',
    number: 77.23,
    unit: '兆瓦时',
  }
  dataInfo.test = {
    name: '今日核酸采集量',
    number: 12128,
    unit: '人',
  }

  eventList.value = [
    { name: '火警', type: '存在隐患，需派人排除隐患', position: { x: 53, y: 57 } },
    { name: '电力', type: '存在隐患，需派人排除隐患', position: { x: 83, y: 17 } },
    { name: '火警', type: '出现事故，需紧急处理', position: { x: 53, y: 27 } },
    { name: '治安', type: '重大事故，需派人支援', position: { x: 23, y: 17 } },
  ]
}
</script>
